#include "PDTExpBoolBin.h"
#include "PDTCodeGraph.h"

//PDTExpBoolBin::PDTExpBoolBin(PDTCodeGraph & CG):PDTExpBool(CG){
//    //maybe intialize to some value
//}

void PDTExpBoolBin::setLeft(PDTExp&left){
	writers[0]=&left;
	addChild(&left);
	left.addReader(this);
	left.addParent(this);


}

void PDTExpBoolBin::setRight(PDTExp &right){
	writers[1]=&right;
	addChild(&right);
	right.addReader(this);
	right.addParent(this);

}


PDTExpBoolBin::PDTExpBoolBin(PDTCodeGraph & CG,PDTExp &left,PDTExp & right):PDTExpBool(CG){
	addWriter(&left);
	addChild(&left);
	left.addReader(this);
	left.addParent(this);


	addWriter(&right);
	addChild(&right);
	right.addReader(this);
	right.addParent(this);


}

PDTExp * PDTExpBoolBin::getLeft(){
	return dynamic_cast<PDTExp*>(writers[0]);
}

PDTExp * PDTExpBoolBin::getRight(){
	return dynamic_cast<PDTExp*>(writers[1]);
}

